package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.ReservationDTO;
import com.zzyl.entity.Reservation;
import com.zzyl.vo.ReservationCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Mapper
public interface CustomerReservationMapper {

    Integer getCancelledReservationCount(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("userId") Long userId);

    void insert(ReservationDTO reservationdto);

    Page<Reservation> selectByPage(Integer status);


    void upstateById(Reservation reservation);

    List<ReservationCountVo> countReservationsTimeRange(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    void updateExpiredReservations(Date now);
}
